﻿using DLLPC.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace VisionCore
{
    public class DelayOnHelper_EQ
    {
        static Thread thread;
        static bool isRun = true;

        public static void Start()
        {
            thread = new Thread(TreadFunc);
            thread.IsBackground = true;
            thread.Start();
        }

        public static void Quit()
        {
            isRun = false;
        }

        static void TreadFunc()
        {
            while (isRun)
            {
                AutoMode.Monitor(3000);
                ToInit.Monitor(1000);
                ToForceStop.Monitor(2000);
                AllAxisStop.Monitor(5000);

                InspIonError.Monitor(4000);

                SystemTimeCounter.timeBeginPeriod(1);
                Thread.Sleep(1);
                SystemTimeCounter.timeEndPeriod(1);
            }
        }

        public static DelayOn AutoMode = new DelayOn("自动运转");
        public static DelayOn ToInit = new DelayOn("初始化");
        public static DelayOn ToForceStop = new DelayOn("强制停止");
        public static DelayOn AllAxisStop = new DelayOn("所有轴停止");

        public static DelayOn InspIonError = new DelayOn("检测平台静电棒异常");
    }
}
